package com.hontlong.aixue.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hontlong.aixue.bean.User;
import com.hontlong.aixue.bean.ZhiShi;
import com.hontlong.aixue.dao.ZhiShiDao;

@Service
public class ZhiShiService {
	@Autowired
	private ZhiShiDao zhishiDao;

	public void add(User user, String zhishi) {
		zhishiDao.add(user,zhishi);
	}

	public ZhiShiDao getZhishiDao() {
		return zhishiDao;
	}
	
	public List<ZhiShi> list(final int pageIndex, final int pageSize) {
		return zhishiDao.list(pageIndex, pageSize);
	}

	public List<ZhiShi> list(String userName, int pageIndex, int pageSize) {
		return zhishiDao.list(userName, pageIndex, pageSize);
	}

	public void setZhishiDao(ZhiShiDao zhishiDao) {
		this.zhishiDao = zhishiDao;
	}

	public int total() {	    
	    return zhishiDao.total();
	}
}
